package com.whub507.msgmanager.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.whub507.msgmanager.common.ResResult;
import com.whub507.msgmanager.domain.Message;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;

public interface MessageService extends IService<Message> {
//    Boolean createOrUpdateMessage(String projectName, String msgTitle, Integer type, String sendTime, String phoneNums, String content, String department, String contentType, String target, String node, Integer done) throws ParseException;

    List<Message> searchMessage(Integer projectId, String keyWord);

    ResResult<Boolean>  uploadMessage(MultipartFile file,Integer projectId);

    ResResult<Boolean> formUploadMessage(Message message);

    ResResult<Boolean> validateMessage(Integer projectId, List<String> nodeAndTitles) throws ParseException;

    void downloadMsgTemplate(HttpServletRequest request, HttpServletResponse response) throws IOException;

    Boolean downloadMsg(HttpServletRequest request, HttpServletResponse response, Integer projectId, String node, String title) throws IOException;

    List<Message> getAllMsgs(Integer projectId);

    Boolean deleteMsg(Integer projectId, List<String> nodeAndTitles);

    String sentMsg(Message message);

    ResResult<Boolean> editMsg(Message message, String preNode, String preTitle);
}
